import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
      '@components': path.resolve(__dirname, './src/components')
    }
  },


  server:{
    host:'0.0.0.0',
    port:5173,
    proxy:{
      '/api': {
        target: env.VITE_API_BASE_URL,
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, ''),
        // 其他配置
        onProxyReq(proxyReq) {
          console.log('Proxying request to:', proxyReq.path)
        }
      }
    }
  }

})